package com.wws.family.ui.activity

import android.os.Bundle
import com.wika.basics.base.BaseActivity
import com.wika.basics.base.fragment.StackManager.SINGLE_TOP
import com.wws.family.R
import com.wws.family.databinding.ActivityMainBinding
import com.wws.family.ui.fragment.HomeFragment
import com.wws.family.ui.fragment.MineFragment


/**
 *@Description: 主页
 *@Date: 2024/9/19 23:01
 *@Author: WangWeiShuo
 */
class MainActivity: BaseActivity<ActivityMainBinding>() {

    private var hasLoadFragment = false
    override fun initView(savedInstanceState: Bundle?) {
        mBinding.rgNav.setOnCheckedChangeListener { group, checkedId ->
            when(checkedId){
                R.id.rb_home -> {
                    setStatusBar(true,getColor(R.color.white),false)
                    if (hasLoadFragment){
                        openFragment(HomeFragment(),null, SINGLE_TOP)
                    }else{
                        initFragment(HomeFragment(),R.id.fragment_container)
                    }
                }
                R.id.rb_mine -> {
                    setStatusBar(true,getColor(R.color.teal_200),false)
                    openFragment(MineFragment(),null, SINGLE_TOP)
                }
            }
        }
        mBinding.rbHome.isChecked = true
    }

    override fun initData() {

    }

    override fun needFullScreen(): Boolean {
        return false
    }

    override fun actionBarRightClick() {
        TODO("Not yet implemented")
    }

    override fun onResume() {
        super.onResume()
    }
}